{extend name="public/base" /}
{block name="body"}
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">
                配置管理 &nbsp;&nbsp;
                [{eq name="$param['group']" value=""}
                <span>全部</span>
                {else /}
                <a href="{:url('')}">全部</a>
                {/eq}
                {foreach $group as $key=>$vo}
                {eq name="$param['group']" value="$key"}
                <span>{$vo}</span>
                {else /}
                <a href="{:url('?group='.$key)}">{$vo}</a>
                {/eq}
                {/foreach}]
            </div>
            <div class="layui-card-body">
                <div class="layui-row zz-row-operate">
                    <div class="zz-operate-btn-group">
                        <a class="layui-btn open-win" title="新增后台菜单" href="{:url('add')}">新 增</a>
                        <a class="layui-btn layui-btn-danger zz-btn-select-all" href="{:url('del')}">批量删除</a>
                    </div>
                    <form action="{:url('')}" class="layui-form zz-form-search zz-form zz-form-right">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="title" placeholder="请输入配置名称" value="{$param['title']}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn" lay-submit>
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                            </button>
                        </div>
                    </form>
                </div>

                <div class="layui-form">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th class=" layui-table-col-special" width="18px">
                                <input type="checkbox" lay-filter="zz-checkbox-table" lay-skin="primary">
                            </th>
                            <th>ID</th>
                            <th>名称</th>
                            <th>标题</th>
                            <th>分组</th>
                            <th>类型</th>
                            <th width="60px">排序</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="lists" id="vo"}
                        <tr>
                            <td><input type="checkbox" class="zz-table-chk-item" value="{$vo.id}" lay-skin="primary"></td>
                            <td>{$vo.id}</td>
                            <td><a href="{:url('edit?id='.$vo['id'])}">{$vo.name}</a></td>
                            <td>{$vo.title}</td>
                            <td>{$vo.group}</td>
                            <td>{$vo.type}</td>
                            <td>
                                <form action="{:url('sort')}" method="post" class="layui-form zz-form-datalist" lay-filter="zz-form-{$vo.id}">
                                    <input type="hidden" value="{$vo.id}" name="id">
                                    <input type="text" name="sort" data-source="{$vo.sort}" lay-verify="required|number" autocomplete="off" value="{$vo.sort}" class="layui-input zz-table-input">
                                </form>
                            </td>
                            <td>
                                <a href="{:url('edit?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-normal open-win" title="编辑后台菜单">编辑</a>
                                <a href="{:url('del?ids='.$vo['id'])}" class="layui-btn layui-btn-danger layui-btn-xs confirm ajax-post">删除</a>
                            </td>
                        </tr>
                        {/volist}

                        </tbody>
                    </table>
                    {if $lists->isEmpty()}
                    <div class="zz-data-empty">
                        <i class="layui-icon layui-icon-tips"></i>暂无记录！
                    </div>
                    {else/}
                    {$lists|raw}
                    {/if}

                </div>
            </div>
        </div>
    </div>
</div>

{/block}